<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html"
	renderKitId="PRIMEFACES_MOBILE">

	<pm:page title="George Mason Survey">

	<!-- Login View 
		<pm:view id="login">
			<pm:header title="Authenticate" swatch="b">
			</pm:header>
			<pm:content>
				<h4>Use of the CMI is restricted those given a passscord</h4>
				<h:form>
					<h:outputText id="message" style="color: red"
						value="#{surveyManager.message}" />
					<p:inputText type="password" label="Passcode: "
						value="#{surveyManager.passcode}" />
					<p:commandButton id="loginButton" value="Login"
						action="" update="message" />
				</h:form>
			</pm:content>
			<pm:footer fixed="true">
				<h3>The Interface and Code is Protected </h3>
				<h3>by a Copyright, John F. Sacco  </h3>      	
			</pm:footer>			
		</pm:view>
	-->

		<!-- Main View -->
		<pm:view id="main">
			<pm:header title="Rate Rules" swatch="b">
			</pm:header>
			<pm:content>
				<h4>Rate Yourself Using the Following Global Mindset Inventory
					(GMI) Scale</h4>
				<p:dataList>
					<h:outputText value=" 1 --  Not At All " />
					<h:outputText value=" 2 --  Small Extent" />
					<h:outputText value=" 3 --  Moderate Extent" />
					<h:outputText value=" 4 --  Large Extent" />
					<h:outputText value=" 5 --  Very Large Extent" />
				</p:dataList>
				<br />
				<br />
				<br />
				<h:form>
					<p:commandButton value="Start" action="#{surveyManager.goQ1}" />
				</h:form>
			</pm:content>
		</pm:view>

		<!-- Question 1 View -->
		<pm:view id="q1">
			<pm:header title="Intellectual Capital" swatch="b">
			</pm:header>
			<pm:content>

				<h4>Intellectual Capital Sample Questions</h4>
				<h:form>
					<pm:inputRange id="q1-4" minValue="1" maxValue="5"
						value="#{surveyManager.scores[3]}"
						label="Know how global events may affect your industry." />
					<pm:inputRange id="q1-5" minValue="1" maxValue="5"
						value="#{surveyManager.scores[4]}"
						label="Know about the geography and history of several cultures." />
					<pm:inputRange id="q1-6" minValue="1" maxValue="5"
						value="#{surveyManager.scores[5]}"
						label="Have the ability to understand abstract ideas." />


					<p:commandButton value="Next" action="#{surveyManager.goQ2}" />
				</h:form>
			</pm:content>
		</pm:view>

		<!-- Question 2 View -->
		<pm:view id="q2">
			<pm:header title="Psychological Capital " swatch="b">
			</pm:header>
			<pm:content>
				<h4>Psychological Capital Sample Questions</h4>
				<h:form>
					<pm:inputRange id="q1-1" minValue="1" maxValue="5"
						value="#{surveyManager.scores[0]}"
						label="Enjoy exploring other countries.	" />
					<pm:inputRange id="q1-2" minValue="1" maxValue="5"
						value="#{surveyManager.scores[1]}"
						label="Test your personal abilities." />
					<pm:inputRange id="q1-3" minValue="1" maxValue="5"
						value="#{surveyManager.scores[2]}"
						label="Feel comfortable in new environments." />

					<p:commandButton value="Next" action="#{surveyManager.goQ3}" />
				</h:form>
			</pm:content>
		</pm:view>

		<!-- Question 3 View -->
		<pm:view id="q3">
			<pm:header title="Social Capital " swatch="b">
			</pm:header>
			<pm:content>
				<h4>Social Capital Sample Questions</h4>
				<h:form>
					<pm:inputRange id="q1-7" minValue="1" maxValue="5"
						value="#{surveyManager.scores[6]}"
						label="Have the ability to work with people from other cultures." />
					<pm:inputRange id="q1-8" minValue="1" maxValue="5"
						value="#{surveyManager.scores[7]}"
						label="Have a network of people from other cultures." />
					<pm:inputRange id="q1-9" minValue="1" maxValue="5"
						value="#{surveyManager.scores[8]}"
						label="Experience ease with starting a conversation with a stranger." />

					<p:commandButton value="Submit" action="#{surveyManager.calculate}"
						update=":resultDisplay" />
				</h:form>
			</pm:content>
		</pm:view>

		<!-- Result View -->
		<pm:view id="result">
			<pm:header title="Survey Result" swatch="b">
			</pm:header>
			<pm:content>
				<h2>
					Your final score is
					<h:outputText id="resultDisplay"
						value="#{surveyManager.finalScore}" />
				</h2>
				<h3>5 which would mean that you have the potential be strong
					cross cultural leader.</h3>
				<h:form>
					<p:commandButton value="Try Again"
						action="#{surveyManager.goMainView}" />
				</h:form>
			</pm:content>
		</pm:view>

	</pm:page>
</f:view>